package org.hk;

import org.hk.utils.SpringMVCContextUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class InitListener implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        SpringMVCContextUtils.ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {

    }
}
